package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * 采购订单实体类
 */
@ApiModel(value = "采购信息实体类",description = "封装采购订单相关信息")
@TableName("t_buy")
public class BuyBean {
    /**编号**/
    @ApiModelProperty("编号")
    @TableId(value = "pk_buyId", type = IdType.AUTO)
    private Integer id;
    /**供应商名**/
    @ApiModelProperty("供应商名")
    @TableField("b_supplier")
    private String supplier;
    /**采购人**/
    @ApiModelProperty("采购人")
    @TableField("b_person")
    private String person;
    /**采购日期**/
    @ApiModelProperty("采购日期")
    @TableField("b_date")
    private LocalDate date= LocalDate.now();
    /**采购明细集合**/
    @ApiModelProperty("采购明细集合")
    @TableField(exist = false)
    private List<BuyDetailBean> buyDetailList;

    public BuyBean() {
    }

    public BuyBean(String supplier, String person) {
        this.supplier = supplier;
        this.person = person;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getPerson() {
        return person;
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public List<BuyDetailBean> getBuyDetailList() {
        return buyDetailList;
    }

    public void setBuyDetailList(List<BuyDetailBean> buyDetailList) {
        this.buyDetailList = buyDetailList;
    }

    @Override
    public String toString() {
        return "BuyBean{" +
                "id=" + id +
                ", supplier='" + supplier + '\'' +
                ", person='" + person + '\'' +
                ", date=" + date +
                ", buyDetailList=" + buyDetailList +
                "}\n";
    }
}
